package com.bilibili.service.impl;

import com.bilibili.dao.FollowDao;
import com.bilibili.dao.UserDao;
import com.bilibili.dao.VideoDao;
import com.bilibili.dao.impl.FollowDaoImpl;
import com.bilibili.dao.impl.UserDaoImpl;
import com.bilibili.dao.impl.VideoDaoImpl;
import com.bilibili.entity.Follow;
import com.bilibili.service.FollowService;

public class FollowServiceImpl implements FollowService {
	FollowDao fd = new FollowDaoImpl();

	@Override
	public int SelectFollower(int followeeId) {
		// TODO Auto-generated method stub
		return fd.SelectFollower(followeeId);
	}

	VideoDao videoDao = new VideoDaoImpl();

	@Override
	public boolean deleteVideosByVideoId(int user_id, int VideoId) {
		// TODO Auto-generated method stub
		return videoDao.deleteVideosByVideoId(user_id, VideoId) == 1;
	}

	public boolean insertMyAttention(Follow follow) {
		// TODO Auto-generated method stub
		return fd.insertMyAttention(follow) == 1;
	}

	public boolean deleteMyAttention(Follow follow) {
		// TODO Auto-generated method stub
		return fd.deleteMyAttention(follow) == 1;
	}

	@Override
	public int selectUpFS(int videoId) {
		// TODO Auto-generated method stub
		UserDao ud = new UserDaoImpl();
		return fd.SelectFollower(ud.selectUpAllInfo(videoId).getUserId());
	}

	@Override
	public Follow selectUserIsFollower(Follow follow) {
		// TODO Auto-generated method stub
		return fd.selectUserIsFollower(follow);
	}

}
